from django.conf.urls.defaults import *

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

# rtve
from django.views.generic import list_detail
from rtve.core.models import Show
import rtve.core.views 
from rtve.feed.models import LatestShows
import rtve.feed.views 


shows_info = {
    'queryset' : Show.objects.all().order_by('name'),
}

feeds = {
    'shows': LatestShows,
}

urlpatterns = patterns('',
    # Example:
    #(r'^rtve/', include('rtve.foo.urls')),
    
    (r'^$', list_detail.object_list, shows_info),
    (r'^search/.*', rtve.core.views.search_wrapper),
    (r'^create/', rtve.feed.views.createFeed),
    (r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}),
 
    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    (r'^admin/(.*)', admin.site.root),
)
